<div class="row">
	<div class="col-lg-12">
		<div class="ibox float-e-margins">
			<div class="ibox-content">
				<div class="">
					<a class="btn btn-primary " href="javascript:void(0)" >${_res["systemManage.username"]}：${user.loginname!}</a>
				</div>
				<form id="addForm" class="form-horizontal" name="theForm" method="post" action="${cxt!}/platform/userRole/add" novalidate>
					<div class="ibox-content">
					
					<input type="hidden" class="form-control" name="userRole.userid" placeholder="${_res['systemManage.userid']}" value="${user.id!}">
					
					
						<div class="form-group">
							<div class="well">
								<h3>
								 	<!-- <label class="checkbox-inline i-checks" ><input type="checkbox" >角色列表</label> -->
								 	<label >${_res["systemManage.roleList"]}:</label>
								</h3>
								<% for(role in roleList!){ %>
								    <% if(role.isHasRole!){ %>
										<label class="checkbox-inline i-checks"><input name="userRole.roleid" checked="checked" type="checkbox" value="${role.id!}">${role.name!}</label>
									<%   }else{ %> 
										<label class="checkbox-inline i-checks"><input name="userRole.roleid"  type="checkbox" value="${role.id!}">${role.name!}</label>
									<% } %>	
								<% } %>
							</div>
						</div>
 						<div class="form-group">
							<div class="well">
								<h3>${_res["systemManage.allSelect"]}</h3>
								<label class="checkbox-inline i-checks" id="allCheck"><input type="checkbox" value="">${_res["systemManage.allSelect"]}</label>
							</div>
						</div> 
						<div class="form-group">
							<div class="col-sm-2 col-sm-offset-2">
								<button type="button" class="btn btn-primary" onClick="ajaxForm('content', 'addForm')"><i class="fa fa-check"></i>${_res["system.submit"]}</button>
								<button type="button" class="btn btn-white" onClick="ajaxContent('/platform/user/list')">${_res["system.cancel"]}</button>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<#nav />


 <script>
$(document).ready(function () {
 $('.i-checks').iCheck({
	checkboxClass: 'icheckbox_square-green',
	//radioClass: 'iradio_square-green',
	increaseArea: '20%'
  });
  
  
   // 全选
  $("#allCheck").on("ifChecked",function(event){				  
	  $(".i-checks").each(function(){
		  $(".i-checks").iCheck("check");
		  })
	  })
  //全不选
   $("#allCheck").on("ifUnchecked",function(event){				  
	  $(".i-checks").each(function(){
		  $(".i-checks").iCheck("uncheck");
		  })
	  })
 
  //整组选取
  $("h3 > .i-checks").on("ifChanged",function(event){
	  $(this).parent("h3").siblings(".i-checks").iCheck("toggle");
	  })

     });
 </script>
